package com.wiscamp.ninechapters.tags.domain.repositories;

import com.wiscamp.ninechapters.tags.domain.models.Course;
import com.wiscamp.ninechapters.tags.domain.models.CourseOutline;
import cube.ddd.common.query.PagedObjects;
import cube.ddd.common.query.PagedQuery;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

import java.util.Collection;


public interface CourseRepository {
    //region course
    Course getCourse(@Min(0) long courseId);

    Course getCourseByCode(@NotBlank String courseCode);

    Collection<Course> getCoursesByName(@NotBlank String courseName);

    Collection<Course> getAvailableCourses();

    Collection<Course> getCoursesByIds(@NotEmpty Collection<Long> courseIds);

    PagedObjects<Course> getCoursesByQuery(@NotNull PagedQuery query);

    Course saveCourse(@NotNull Course course);
    // endregion


    // region outline
    CourseOutline getOutline(@Min(0) long outlineId);

    Collection<CourseOutline> getOutlinesByCourse(@Min(0) long courseId);

    Collection<CourseOutline> getOutlinesByCourseIds(@NotEmpty Collection<Long> courseIds);

    Collection<CourseOutline> getOutlinesByParent(@Min(0) long courseId, @Min(0) long parentId);

    CourseOutline saveCourseOutline(@NotNull CourseOutline outline);
    // endregion
}
